package com.example.hfSystem.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.example.hfSystem.entity.pojo.HfOrder;
import com.example.hfSystem.dao.HfOrderMapper;
import com.example.hfSystem.service.HfOrderService;

import com.example.hfSystem.utils.PageUtils;
import com.example.hfSystem.utils.Query;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 汉服订单表 服务实现类
 * </p>
 *
 * @since 2024-04-09
 */
@Service
public class HfOrderServiceImpl extends ServiceImpl<HfOrderMapper, HfOrder> implements HfOrderService {
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<HfOrder> page = this.selectPage(
                new Query<HfOrder>(params).getPage(),
                new EntityWrapper<HfOrder>()
        );
        return new PageUtils(page);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params, Wrapper<HfOrder> wrapper) {
        Page<HfOrder> page = new Query<HfOrder>(params).getPage();
        page.setRecords(baseMapper.selectListView(page, wrapper));
        PageUtils pageUtil = new PageUtils(page);
        return pageUtil;
    }


    @Override
    public List<HfOrder> selectListVO(Wrapper<HfOrder> wrapper) {
        return baseMapper.selectListVO(wrapper);
    }

    @Override
    public HfOrder selectVO(Wrapper<HfOrder> wrapper) {
        return baseMapper.selectVO(wrapper);
    }

    @Override
    public List<HfOrder> selectListView(Wrapper<HfOrder> wrapper) {
        return baseMapper.selectListView(wrapper);
    }

    @Override
    public HfOrder selectView(Wrapper<HfOrder> wrapper) {
        return baseMapper.selectView(wrapper);
    }

}
